<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Position extends Model {
	public static $rules = [
		'type' => 'required|max:255',
		'name' => 'required|max:20',
		'address' => 'required|max:20',
		'nature' => 'required|max:20',
		'minSalary' => 'required|max:64',
		'maxSalary' => 'required|max:64',
		'edu' => 'required|max:64',
		'deptName' => 'required|max:255',
		'person' => 'required|max:20',
		'experience' => 'required|max:64',
		'demand' => 'required|max:500',
		'duty' => 'required|max:500',
	];
	public static $message = [
		'type.required' => '职位类型不能为空',
		'type.max' => '职位类型最多255个字符',
		'name.required' => '职位名称不能为空',
		'name.max' => '职位名称最多20个字符',
		'address.required' => '工作地点不能为空',
		'address.max' => '工作地点最多20个字符',
		'nature.required' => '工作性质不能为空',
		'nature.max' => '工作性质最多20个字符',
		'minSalary.required' => '最低薪资不能为空',
		'minSalary.max' => '最低薪资最多64个字符',
		'maxSalary.required' => '最高薪资不能为空',
		'maxSalary.max' => '最高薪资最多64个字符',
		'edu.required' => '最低学历不能为空',
		'edu.max' => '工最低最多64个字符',
		'deptName.required' => '所属部门不能为空',
		'deptName.max' => '所属部门最多255个字符',
		'person.required' => '负责人不能为空',
		'person.max' => '负责人最多20个字符',
		'experience.required' => '工作经验不能为空',
		'experience.max' => '工作经验最多64个字符',
		'demand.required' => '岗位要求不能为空',
		'demand.max' => '岗位要求最多500个字符',
		'duty.required' => '任职要求不能为空',
		'duty.max' => '任职要求最多500个字符',
	];
	protected function getDateFormat() {
		return time();
	}
	protected $fillable = [
		'user_id', 'company_id', 'type', 'name', 'address', 'nature', 'min_salary', 'max_salary', 'edu', 'dept_name', 'person', 'experience', 'demand', 'duty', 'number',
	];
}
